Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client-sdk: Add PrettyPrint to StakeThresholds #2066

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

matevz
Copy link
Member

@matevz matevz commented Nov 18, 2024

This PR implements PrettyPrint() for StakeThresholds. Improves output of oasisprotocol/cli#318 to

$ oasis paratime show parameters --network testnet
Network:        testnet
ParaTime:       sapphire

=== ROFL PARAMETERS ===
  Stake thresholds:
    App create: 10000.0 TEST

Copy link

netlify bot commented Nov 18, 2024

Deploy Preview for oasisprotocol-oasis-sdk canceled.

Name Link
🔨 Latest commit 563856d
🔍 Latest deploy log https://app.netlify.com/sites/oasisprotocol-oasis-sdk/deploys/6756cee50f558b00082b59c0

@kostko
Copy link
Member

kostko commented Nov 18, 2024

=== ROFL_STAKETHRESHOLDS PARAMETERS ===

This looks ugly, why is it not rofl.StakeThresholds PARAMETERS or similar?

@matevz matevz force-pushed the matevz/feature/stake-thresholds-prettyprint branch from 26cb546 to 4565a33 Compare November 18, 2024 15:39
@matevz
Copy link
Member Author

matevz commented Nov 18, 2024

=== ROFL_STAKETHRESHOLDS PARAMETERS ===

This looks ugly, why is it not rofl.StakeThresholds PARAMETERS or similar?

The idea was to resemble oasis net show parameters output, e.g.

=== SCHEDULER PARAMETERS ===
  min_validators: 3
  max_validators: 110
  max_validators_per_entity: 1
  reward_factor_epoch_election_any: 0

=== BEACON PARAMETERS ===
  backend: vrf
  vrf_parameters:
    alpha_hq_threshold: 3
    interval: 600
    proof_delay: 300
    gas_costs:
      vrf_prove: 1000

=== GOVERNANCE PARAMETERS ===
  gas_costs:
    cast_vote: 1000
    submit_proposal: 1000
  min_proposal_deposit: 10000000000000
  voting_period: 12
  stake_threshold: 68
  upgrade_min_epoch_diff: 24
  upgrade_cancel_min_epoch_diff: 15
  enable_change_parameters_proposal: true
  allow_vote_without_entity: true
  allow_proposal_metadata: true

But I agree, it's not readable. This should look better:

=== ROFL PARAMETERS ===
  Stake thresholds:
    App create: 10000.0 TEST
```

@matevz matevz force-pushed the matevz/feature/stake-thresholds-prettyprint branch from 4565a33 to ab78595 Compare November 19, 2024 11:24
@matevz matevz force-pushed the matevz/feature/stake-thresholds-prettyprint branch 2 times, most recently from 40ce20e to 563856d Compare December 9, 2024 11:05
@matevz matevz merged commit 7f9efcf into main Dec 9, 2024
26 checks passed
@matevz matevz deleted the matevz/feature/stake-thresholds-prettyprint branch December 9, 2024 11:42
github-actions bot added a commit that referenced this pull request Dec 9, 2024
…atevz/feature/stake-thresholds-prettyprint

client-sdk: Add PrettyPrint to StakeThresholds 7f9efcf
github-actions bot added a commit that referenced this pull request Dec 9, 2024
…/matevz/feature/stake-thresholds-prettyprint

client-sdk: Add PrettyPrint to StakeThresholds 7f9efcf
github-actions bot added a commit to OasisUnofficial/oasis-sdk that referenced this pull request Dec 9, 2024
…sisprotocol/matevz/feature/stake-thresholds-prettyprint

client-sdk: Add PrettyPrint to StakeThresholds 7f9efcf
github-actions bot added a commit to OasisUnofficial/oasis-sdk that referenced this pull request Dec 9, 2024
…oasisprotocol/matevz/feature/stake-thresholds-prettyprint

client-sdk: Add PrettyPrint to StakeThresholds 7f9efcf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants